<!-- 设备事件页面 -->
<template>
  <div id="event-main">
    <div id="statistics-mian">
      <div id="event-statistics">
        <div id="event-statistics-state">
          <a-button type="primary" @click="query1">
            <div>
              <div class="event-num">8</div>
              <div>全部</div>
            </div>
          </a-button>
          <a-button @click="query2">
            <div>
              <div class="event-num">6</div>
              <div>未处理</div>
            </div>
          </a-button>
          <a-button @click="query3">
            <div>
              <div class="event-num">2</div>
              <div>已处理</div>
            </div>
          </a-button>
        </div>
        <div id="event-statistics-type">
          <a-button type="primary" status="danger" @click="query5">
            <div>
              <div class="event-num">3</div>
              <div>红色报警</div>
            </div>
          </a-button>
          <a-button type="primary" status="success" @click="query6">
            <div>
              <div class="event-num">5</div>
              <div>已恢复</div>
            </div>
          </a-button>
        </div>
      </div>
    </div>
    <!-- 筛选条件的组件 -->
    <div class="componentsd">
      <Condition></Condition>
    </div>

    <!-- 数据表的组件 -->
    <div class="componentsd">
      <DeviceList></DeviceList>
    </div>
  </div>
</template>

<script setup lang="ts">
import Condition from "./component/DeviceCondition.vue";
import DeviceList from "./component/DeviceList.vue";
import { useDacive } from "../store/daciveData";
let dactive = useDacive();
dactive.runAllAction();
// 上侧按钮的点击查询
let query1 = () => {
  dactive.stateWhereAction(null);
};
let query2 = () => {
  dactive.stateWhereAction(1);
};
let query3 = () => {
  dactive.stateWhereAction(2);
};
let query5 = () => {
  dactive.alarmWhereAction(1);
};
let query6 = () => {
  dactive.alarmWhereAction(2);
};
</script>

<style scoped>
#event-main {
  height: 100%;
  margin-top: 70px;
}

#event-statistics {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 90px;
  border: 1px solid #f2f2f2;
}

#statistics-mian {
  margin: 10px;
  /* height: 100%; */
}
#event-statistics button {
  width: 80px;
  height: 70px;
  margin: 5px;
  padding: 5px;
}
#event-statistics .event-num {
  font-size: 28px;
}
.componentsd {
  margin: 10px;
}
</style>
